# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=regview
pkgver=1.3
pkgrel=3
pkgdesc='Open raw Windows NT 5 Registry files (Windows 2000 or higher).'
groups=('blackarch' 'blackarch-windows' 'blackarch-forensic')
arch=('any')
makedepends=('p7zip' 'curl')
url='https://www.gaijin.at/en/dlregview.php'
source=('https://www.gaijin.at/downlo4d/regview.7z')
DLAGENTS=("https::/usr/bin/curl -A 'Mozilla' -fLC - --retry 3 --retry-delay 3 -o %o %u")
sha512sums=('34301474b45b3bf88e93b89106e70bfd6718ce8ee49604bdeb0b95b05b597a1bc9d61aca39459766c82919de2e7582a383e736441a4bc18d12032e234e0afd7f')

pkgver() {
  ver=$(curl -s -H 'User-Agent: Mozilla' https://www.gaijin.at/en/dlregview.php |
  grep -P 'download_value' | grep -m1 -o -P '\d+\.\d+')

  echo "$ver"
}

package() {
  install -dm 755 "$pkgdir/usr/share/windows/$pkgname"

  7z e -y regview.7z

  rm -rf './regview.7z'

  cp -a * "$pkgdir/usr/share/windows/$pkgname/"
}

